package com.navinfo.opentsp.qingqi.trackoptimize.common.handler;


import com.navinfo.opentsp.qingqi.trackoptimize.common.command.Command;

/**
 * Common command handler interface
 */
public interface CommandHandler<C extends Command<?>, CR extends Command.Result> {
    /**
     * Handle a command
     * @param command command to handle
     * @return command handling result
     */
    CR handle(C command);

    /**
     * @return Class of command which handler can process
     */
    Class<C> getCommandType();

    /**
     *
     * @return Class of result which handler produces
     */
    Class<CR> getResultType();
}
